<#assign ctx=request.contextPath />
<meta charset="UTF-8">
<title>微工匠后台管理系统</title>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="/favicon.ico"/>
<link rel="stylesheet" href="${ctx}/assets/theme/Font-Awesome-4.4.0/css/font-awesome.css"/>
<link rel="stylesheet" href="${ctx}/assets/plugins/layui2.2.6/css/layui.css"/>
<!--[if lt IE 9]>
<script src="${ctx}/assets/plugins/html5shiv/html5shiv.min.js"></script>
<script src="${ctx}/assets/plugins/html5shiv/html5shiv-printshiv.min.js"></script>
<script src="${ctx}/assets/plugins/respond/respond.min.js"></script>
<![endif]-->
<script type="text/javascript" src="${ctx}/assets/jquery/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="${ctx}/assets/theme/jquery-easyui-1.5.2/jquery.easyui.min.js"></script>
<script type="text/javascript" src="${ctx}/assets/theme/jquery-easyui-1.5.2/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="${ctx}/assets/plugins/layui2.2.6/layui.js"></script>
<script type="text/javascript" src="${ctx}/assets/plugins/layui2.2.6/lay.xtree.js"></script>
<script type="text/javascript" src="${ctx}/assets/plugins/validation/jquery.form.js"></script>
<script type="text/javascript" src="${ctx}/assets/plugins/validation/jquery.validate.min.js"></script>
<script type="text/javascript" src="${ctx}/assets/plugins/validation/messages_zh.js"></script>
<script type="text/javascript" src="${ctx}/assets/plugins/validation/jquery.validate.supply.js"></script>
<script type="text/javascript" src="${ctx}/assets/plugins/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="${ctx}/assets/plugins/json2/json2.js"></script>
<script type="text/javascript" src="${ctx}/assets/jquery/jquery.formFill.js"></script>
<script type="text/javascript" src="${ctx}/assets/plugins/utils/string.js"></script>
<script type="text/javascript" src="${ctx}/assets/plugins/utils/date.js"></script>
<script type="text/javascript" src="${ctx}/assets/plugins/echarts/echarts.js"></script>
<script type="text/javascript" src="${ctx}/ftl/js/CSV.js"></script>
<script type="text/javascript" src="${ctx}/ftl/js/IDUtils.js"></script>

<link rel="stylesheet" href="${ctx}/ftl/css/base.css">
<style type="text/css">
    .layui-table, .layui-table-view{
        margin-top: 2px !important;
        /*margin-left: 15px !important;*/
    }
</style>
<script>
/**
 * 在页面中任何嵌套层次的窗口中获取顶层窗口
 * @return 当前页面的顶层窗口对象
 */
function getTopWinow(){
   var topParent = window;
   while(topParent != topParent.parent){
	   topParent = topParent.parent;
   }
   return topParent;
}
var _pageNum = 1;
var _pageSize = 20;

var pageResponse = {  //如果无需自定义数据响应名称，可不加该参数
    statusName: 'code', //数据状态的字段名称，默认：code
    statusCode: '10000', //成功的状态码，默认：0
    msgName: 'msg', //状态信息的字段名称，默认：msg
    countName: 'total', //数据总数的字段名称，默认：count
    dataName: 'data' //数据列表的字段名称，默认：data
};
var pageRequest = { //如果无需自定义请求参数，可不加该参数
    pageName: 'pageNum', //页码的参数名称，默认：page
    limitName: 'pageSize' //每页数据量的参数名，默认：limit
};
var pagenation={ //支持传入 laypage 组件的所有参数（某些参数除外，如：jump/elem） - 详见文档
    layout: ['limit', 'count', 'prev', 'page', 'next', 'skip'],//自定义分页布局
    first: false, //不显示首页
    last: false,//不显示尾页
    theme: '#1E9FFF',
    limits: [10, 20, 40],
    prev: '上一页',
    next: '下一页'
};
/*表单序列化转JSON*/
$.fn.serializeJson = function() {
    var arr = this.serializeArray();
    var json = {};
    arr.forEach(function(item) {
        var name = item.name;
        var value = item.value;

        if (!json[name]) {
            json[name] = value;
        } else if ($.isArray(json[name])) {
            json[name].push(value);
        } else {
            json[name] = [json[name], value];
        }
    });
    return json;
};
/*非表单 容器转 JSon*/
$.fn.containerJson = function() {
    var inputArr = this.find("input");
    var json = {};
    for (var i = 0; i < inputArr.length; i++){
        var item = inputArr[i];
        var name = item.name;
        var value = item.value;
        if (!json[name]) {
            json[name] = value;
        } else if ($.isArray(json[name])) {
            json[name].push(value);
        } else {
            json[name] = [json[name], value];
        }
    }
    return json;
};
//dateformat
function dateFormatter(value) {
    if (value) {
        var date = new Date(value);
        var Y = date.getFullYear() + "-";
        var M = check(date.getMonth() + 1) + "-";
        var D = check(date.getDate()) + " ";
        var H = check(date.getHours()) + ":";
        var m = check(date.getMinutes()) + ":";
        var s = check(date.getSeconds());
        return Y + M + D + H + m + s;
    }
}
//检查是不是两位数字，不足补全
function check(str) {
    str = str.toString();
    if (str.length < 2) {
        str = '0' + str;
    }
    return str;
}

</script>
